﻿Namespace Seguranca.Dominio

    ''' <summary>
    ''' Classe Permissao de Segurança
    ''' </summary>
    ''' <remarks></remarks>
    <Serializable()> _
    Public Class Permissao

        Private _id As Nullable(Of Long)

        ''' <summary>
        ''' Identificador de Segurança
        ''' </summary>
        ''' <value>Long</value>
        ''' <returns>Long</returns>
        ''' <remarks></remarks>
        Public Overridable Property Id() As Nullable(Of Long)
            Get
                Return _id
            End Get
            Set(ByVal value As Nullable(Of Long))
                _id = value
            End Set
        End Property

        Private _descricao As String

        ''' <summary>
        ''' Descrição da Permissão
        ''' </summary>
        ''' <value>String</value>
        ''' <returns>String</returns>
        ''' <remarks></remarks>
        Public Overridable Property Descricao() As String
            Get
                Return _descricao
            End Get
            Set(ByVal value As String)
                _descricao = value
            End Set
        End Property

        Private _tipoPermissao As TipoPermissao

        ''' <summary>
        ''' Propriedade _tipoPermissao
        ''' </summary>
        ''' <value>TipoPermissao(classe TipoPermissao)</value>
        ''' <returns>TipoPermissao(classe TipoPermissao)</returns>
        ''' <remarks></remarks>
        Public Overridable Property TipoPermissao() As TipoPermissao
            Get
                Return _tipoPermissao
            End Get
            Set(ByVal value As TipoPermissao)
                _tipoPermissao = value
            End Set
        End Property

        Private _tipoModulo As TipoModulo

        ''' <summary>
        ''' Propriedade _tipoModulo
        ''' </summary>
        ''' <value>TipoModulo(classe TipoModulo)</value>
        ''' <returns>TipoModulo(classe TipoModulo)</returns>
        ''' <remarks></remarks>
        Public Overridable Property TipoModulo() As TipoModulo
            Get
                Return _tipoModulo
            End Get
            Set(ByVal value As TipoModulo)
                _tipoModulo = value
            End Set
        End Property

        Private _papeis As IList(Of Papel)

        ''' <summary>
        ''' Papeis da permissão
        ''' </summary>
        ''' <value>Lista(classe Papel)</value>
        ''' <returns>Lista(classe Papel)</returns>
        ''' <remarks></remarks>
        Public Overridable Property Papeis() As IList(Of Papel)
            Get
                If _papeis Is Nothing Then
                    _papeis = New List(Of Papel)
                End If
                Return _papeis
            End Get
            Set(ByVal value As IList(Of Papel))
                _papeis = value
            End Set
        End Property

        'Usado em páginas e web services
        Private _path As String

        ''' <summary>
        ''' Caminho de páginas e web services
        ''' </summary>
        ''' <value>String</value>
        ''' <returns>String</returns>
        ''' <remarks></remarks>
        Public Overridable Property Path() As String
            Get
                Return _path
            End Get
            Set(ByVal value As String)
                _path = value
            End Set
        End Property

        'Usado em operações
        Private _tipoOperacao As Nullable(Of TipoOperacao)

        ''' <summary>
        ''' Propriedade _tipoOperacao
        ''' </summary>
        ''' <value>TipoOperacao(classe TipoOperacao)</value>
        ''' <returns>TipoOperacao(classe TipoOperacao)</returns>
        ''' <remarks></remarks>
        Public Overridable Property TipoOperacao() As Nullable(Of TipoOperacao)
            Get
                Return _tipoOperacao
            End Get
            Set(ByVal value As Nullable(Of TipoOperacao))
                _tipoOperacao = value
            End Set
        End Property

        Private _perfisComPermissao As IList(Of Perfil)

        ''' <summary>
        ''' Perfis com permissão
        ''' </summary>
        ''' <value>Lista(classe Perfil)</value>
        ''' <returns>Lista(classe Perfil)</returns>
        ''' <remarks></remarks>
        Public Overridable Property PerfisComPermissao() As IList(Of Perfil)
            Get
                Return _perfisComPermissao
            End Get
            Set(ByVal value As IList(Of Perfil))
                _perfisComPermissao = value
            End Set
        End Property

        Private _perfisComRestricao As IList(Of Perfil)

        ''' <summary>
        ''' Perfis com restrição
        ''' </summary>
        ''' <value>Lista(classe Perfil)</value>
        ''' <returns>Lista(classe Perfil)</returns>
        ''' <remarks></remarks>
        Public Overridable Property PerfisComRestricao() As IList(Of Perfil)
            Get
                Return _perfisComRestricao
            End Get
            Set(ByVal value As IList(Of Perfil))
                _perfisComRestricao = value
            End Set
        End Property

    End Class
End Namespace
